package com.lijie.ljblog.util;


import java.text.SimpleDateFormat;

public final class Constants {
    public static final String URI_PREFIX="/admin";
    public static final String ADMIN_TOKEN = ":admin";
    public static final String USER_TOKEN_HEADER = "Authentication";
    public static final String APP_TOKEN_HEADER = "App-Authentication";
    public static final int HTTP_OK = 200;
    public static final int HTTP_ERROR = 500;
    public static final int MAX_LOG_INFO_LEN = 300;
    public static final String USER_ACCESS_TOKEN_HEADER = "U-Access-Token";
    public static final String USER_REFRESH_TOKEN_HEADER = "U-Refresh-Token";
    public static final String LOGIN_URL = "http://192.168.40.39:8080/#/login";
    public static final String LOG_SOURCE="登录登出";
    public static final String SYS_SOURCE="系统管理";
    public static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyyMMddHHmmss");
    public static final String INTERFACE_ABANDONED="该接口以废弃不可用";
    public static final String PARAM_NOT_NULL="请求参数不能为空！";
    public static final String PARAM_ERROR="请求参数有误！";

    /**
     *  status code
     */
    public static final int MAX_LEN = 300;
    // authorization status code
    public static final int AUTHORIZATION_CODE_ERROR = 40400;
    public static final int AUTHORIZATION_CODE_NOT_FOUND = 40401;
    public static final int AUTHORIZATION_CODE_EXPIRE = 40402;
    public static final int AUTHORIZATION_CODE_APP_SECRET_FALSE = 40403;
    public static final int AUTHORIZATION_CODE_DISABLE = 40404;
    public static final int USER_TOKEN_NOT_FOUND = 40002;
    public static final String USER_TOKEN_UNKNOWN = "未知的token,请重新登录！";
    public static final int APP_TOKEN_NOT_FOUND = 40003;
    public static final int AUTHORIZATION_MENU_NOT_FOUND = 40004;
    public static final String AUTHORIZATION_MENU_REFUESD = "权限不够，访问被拒绝！";


    //expire time
    public static final int AT_EXPIRATION = 30 * 60;
    public static final int RT_EXPIRATION = 10 * 60 * 60;
    public static final int RT_THRESHOLD = 2 * AT_EXPIRATION;


    public static final String USER_LOGIN_INFO = "userLoginInfo";
    public static final String APP_LOGIN_INFO = "appLoginInfo";
    public static final String APP_NAME = "appName";

    public static final String OPERATE_LOG = "operateLog";

    public static final String SUCCESS = "SUCCESS";
    public static final String FAIL = "FAIL";

    public static final String JOIN = "->";

    /**
     * 数字常量
     */
    public static final int NUM_0 = 0;
    public static final int NUM_1 = 1;
    public static final int NUM_2 = 2;

    /**
     * 初始密码
     */
    public static final String INITIAL_PWD = "111111";

    /**
     * 错误信息
     */
    public static final String MESSAGE_ORG_CODE_EXIST = "机构编码已存在";
    public static final String MESSAGE_ORG_NAME_EXIST = "机构名称已存在";

    public static final String MESSAGE_APP_CODE_EXIST = "应用编码已存在";
    public static final String MESSAGE_APP_NAME_EXIST = "应用名称已存在";
    public static final String MESSAGE_APP_USE_NAME_EXIST = "应用用户名已存在";
    public static final String MESSAGE_APP_KEY_NO_EXIST = "应用Key不存在";
    public static final String MESSAGE_APP_OLDPWD_ERROR = "应用旧密码错误";

    public static final String MESSAGE_MENU_PARENT_NO_EXIST = "上级菜单不存在";
    public static final String MESSAGE_MENU_TYPE_ERROR = "菜单类型错误";
    public static final String MESSAGE_MENU_NAME_EXIST = "菜单名称已存在";
    public static final String MESSAGE_MENU_NOT_DELETE = "含有下级，不能删除";
    public static final String MENU_TYPE_CONTENT = "0";
    public static final String MENU_TYPE_MENU = "1";
    public static final String MENU_TYPE_BUTTON = "2";

    public static final String MESSAGE_DATA_FORMAT_ERROR = "传入的时间格式有误！";

    /**
     * controller层错误代码
     */
    public static final int REQUEST_PARAM_ERROR = 41001;
    /**
     * 系统管理三元角色编码
     */
    public static final String ADMIN_SYSTEM="admin";
    public static final String ADMIN_SECRECY ="admin-secrecy";
    public static final String ADMIN_AUDITOR ="admin-auditor";
    /**
     * 系统三元角色对应的菜单menu_perms
     */
    public static final String MENU_SYS_PERMS="admin:system";
    public static final String MENU_USER_PERMS="admin:system:user";
    public static final String MENU_ORG_PERMS="admin:system:org";
    public static final String MENU_ROLE_PERMS="admin:system:role";
    public static final String MENU_LOG_PERMS="admin:system:log";
}
